package com.privasphere.wikidoclet.dataTransport;

public class XmlReaderFactory {
	
	/**
	 * 
	 * @param parserType - An int representing the xmlParserType (1 = DOM), (2 = SAX).
	 * @return obj - The concrete instance of the xmlReader with the appropriate type.
	 */
	public static XmlReadeable<WikiDocPageData> getXmlParser(ParserTypeEnum parserType){
		switch(parserType){
			//It is a DOM parser
			case DOM_PARSER:
				return new XmlReaderDOM();
			//It is a SAX parser;
			case SAX_PARSER:
				return new XmlReaderSAX();
		}
		throw new IllegalArgumentException("The parser type " + parserType + " is not recognized.");
	}
}
